<?php defined("MAIN_DIR") or die("No direct access");

$this_city = $route->getPath(1);
$current_city = $db->getRow("select * from `city` where `path` = '$this_city' and `power` = 'on' limit 1");

if ($current_city) {
	
	$_SESSION['city'] = $current_city['city_id'];
	$c_name = $current_city['path'];
	
	switch ($route->getPath(2)) {
		case "": require_once APP."mainpage.php"; break;
		case "banks": require_once BANKS.MAINFILE; break;
		case "credits": require_once CREDITS.MAINFILE; break;
		case "deposits": require_once DEPOSITS.MAINFILE; break;
		case "currency": require_once APP."currency.php"; break;
		case "mentions": require_once MENTIONS.MAINFILE; break;
		case "polls": require_once APP."polls.php"; break;
		case "graph": require_once APP."graph.php"; break;
		case "admin": to("/admin/");
		
		default: to("/$c_name");
	}
	
} else {
	to();
}

?>